<%-- 
    Document   : viewNameTest
    Created on : Nov 3, 2009, 9:39:18 AM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*,DAO.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%
            String name = request.getParameter("nameTest");
            ResultTestName rsTest = new ResultTestName();
%>
<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" media="screen" href="css/admin.css">
        <title>JSP Page</title>
    </head>
    <body>
        <fieldset class="testView">
            <br>
        <table width=700" class="sample">
            <tr>
                <td align="center">
                    <b>Result Test Of : <span style="color:red;font-size:x-large"><%=name%> </span></b>
                </td>
            </tr>
        </table>
                <table border="1" width="700" class="sample">
            <thead>
                <tr>
                    <th width="25">ID</th>
                    <th width="100">Name</th>
                    <th width="250">TestName</th>
                    <th width="50">StartTime</th>
                    <th width="50">EndTime</th>
                    <th width="50">AnswerTrue</th>
                    <th width="50">Mark</th>
                    <th width="140">Status</th>
                </tr>
            </thead>
            <%
            int i=0;
            ResultSet rsNoFound = rsTest.viewResultTestName(name);
            ResultSet rs = rsTest.viewResultTestName(name);
            while(rs.next())
            {
                %>
            <tbody>
                
                <tr>
                    <td width="25"><%=i%></td>
                    <td width="100"><b><span style="color:fuchsia"><%=rs.getString("UserName")%></span></b></td>
                    <td width="250"><%=rs.getString("TestName")%>(<%=rs.getString("TestTime")%> Phút )</td>
                    <td width="50"><%=rs.getString("StartTime")%></td>
                    <td width="50"><%=rs.getString("EndTime")%></td>
                    <td width="50"><%=rs.getString("AnswerTrue")%></td>
                    <td width="50"><%=rs.getString("Mark")%></td>
                    <td width="140">
                        <%
                            if (rs.getBoolean("Status") == true) {
                        %>
                        <span style="color:red">Đang hoạt động</span>
                        <% } else {
                        %>
                        <span style="color:green">Ngừng họat động </span>
                        <% }%>
                    </td>
                </tr>
            </tbody>
            <%
            i++;
            }
            %>
        </table>
        <table width="700" class="sample">
            <tr>
                <td align="center">
                    <%
                        if(!rsNoFound.next())
                        {
                    %>
                    <span style="color:green">Không có bản ghi nào trong Database</span>
                    <% } %>
                </td>
            </tr>
        </table>
                <br>
        </fieldset>
    </body>
</html>
